package com.special.threademo.requests151demo;

import java.text.Collator;
import java.util.Arrays;
import java.util.Locale;

/**
 * @author LiuYC
 * @version 1.0.0
 * @create 2020-12-26 17:41
 */
public class ChineseSort {

    public static void main(String[] args) {
        String[] strings = {"张三", "李四"};
        /**
         * java Unicode gbk  GBK18030 GBK2312
         * pinyin4j
         *
         * 常见的使用collator进行排序就可以了
         * 同音字多音字等问题汇聚，防止的排序和对应的需求，给予一定的宽容心态！
         *
         *
         */
        Collator c = Collator.getInstance(Locale.CHINA);
        Arrays.sort(strings, c);
        int i = 0;
        for (String str : strings) {
            System.out.println(str);
        }
    }


}
